<?php

namespace App\Http\Resources\Train\TrainOrder;

use Exception;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
use JsonSerializable;

class OtherFeeResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param Request $request
     *
     * @return array|Arrayable|JsonSerializable
     * @throws Exception
     */
    public function toArray($request)
    {
        $fee            = parent::toArray($request);
        $fee['type_uy'] = trans2uy($fee['type_uy']);
        $fee['name_uy'] = trans2uy($fee['name_uy']);
        return $fee;
    }
}
